﻿<Window
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:Controls="clr-namespace:ModbusHelper.WPF.Controls;assembly=ModbusHelper"
        xmlns:Converters="clr-namespace:ModbusHelper.WPF.Converters;assembly=ModbusHelper"
        x:Class="HMI_WPF.Master.Shell"
        Title="HMI-WPF.Master" Height="350" Width="789">
    <Window.Resources>
        <Converters:QualityToBoolConverter x:Key="QualityToBoolConverter" />
        <Converters:ValueToFloatConverter x:Key="ValueToFloatConverter" />
    </Window.Resources>
    <Canvas>

        <CheckBox Content="Digital Input" IsChecked="{Binding DigitalInputTag.Value, Mode=OneWay}" HorizontalAlignment="Left" Height="18" VerticalAlignment="Top" Width="139" Canvas.Left="28" Canvas.Top="10" />
        <CheckBox Content="Digital Coil" IsChecked="{Binding DigitalCoilTag.Value}" HorizontalAlignment="Left" Height="24" VerticalAlignment="Top" Width="139" Canvas.Left="409" Canvas.Top="10" />

        <GroupBox Header="Holding Register Tags" Canvas.Left="409" Canvas.Top="39" Height="170" Width="342">
            <StackPanel Orientation="Vertical" >
                <Controls:NumericInputBox CaptionWidth="215" IsEditable="True" Quality="{Binding HoldingRegisterTagUInt16.Quality, Converter={StaticResource QualityToBoolConverter}}" Caption="HoldingRegisterTagUInt16" HorizontalAlignment="Left"  VerticalAlignment="Top" Value="{Binding HoldingRegisterTagUInt16.Value, StringFormat=N0}" FontSize="16" FontWeight="Bold" Width="330" Height="29" />
                <Controls:NumericInputBox CaptionWidth="215" IsEditable="True" Quality="{Binding HoldingRegisterTagInt16.Quality, Converter={StaticResource QualityToBoolConverter}}" Caption="HoldingRegisterTagInt16" HorizontalAlignment="Left"  VerticalAlignment="Top" Value="{Binding HoldingRegisterTagInt16.Value, Converter={StaticResource ResourceKey=ValueToFloatConverter}, StringFormat=N1}" FontSize="16" FontWeight="Bold" Width="330" Height="29" />
                <Controls:NumericInputBox CaptionWidth="215" IsEditable="True" Quality="{Binding HoldingRegisterTagUInt32.Quality, Converter={StaticResource QualityToBoolConverter}}" Caption="HoldingRegisterTagUInt32" HorizontalAlignment="Left"  VerticalAlignment="Top" Value="{Binding HoldingRegisterTagUInt32.Value, StringFormat=N0}" FontSize="16" FontWeight="Bold" Width="330" Height="29" />
                <Controls:NumericInputBox CaptionWidth="215" IsEditable="True" Quality="{Binding HoldingRegisterTagInt32.Quality, Converter={StaticResource QualityToBoolConverter}}" Caption="HoldingRegisterTagInt32" HorizontalAlignment="Left"  VerticalAlignment="Top" Value="{Binding HoldingRegisterTagInt32.Value, StringFormat=N0}" FontSize="16" FontWeight="Bold" Width="330" Height="29" />
                <Controls:NumericInputBox CaptionWidth="215" IsEditable="True" Quality="{Binding HoldingRegisterTagFloat.Quality, Converter={StaticResource QualityToBoolConverter}}" Caption="HoldingRegisterTagFloat" HorizontalAlignment="Left"  VerticalAlignment="Top" Value="{Binding HoldingRegisterTagFloat.Value, StringFormat=N2}" FontSize="16" FontWeight="Bold" Width="330" Height="29" />
            </StackPanel>
        </GroupBox>
        <GroupBox Header="Input Register Tag" Canvas.Left="28" Canvas.Top="39" Height="170" Width="342">
            <StackPanel>
                <Controls:NumericInputBox Quality="{Binding InputRegisterTagUInt16.Quality, Converter={StaticResource QualityToBoolConverter}}" Caption="InputRegisterTagUInt16" Value="{Binding InputRegisterTagUInt16.Value, Mode=OneWay, StringFormat=N0}" CaptionWidth="200" HorizontalAlignment="Left" Height="29" VerticalAlignment="Top" Width="330"  FontSize="16" FontWeight="Bold"/>
                <Controls:NumericInputBox Quality="{Binding InputRegisterTagInt16.Quality, Converter={StaticResource QualityToBoolConverter}}" Caption="InputRegisterTagInt16" Value="{Binding InputRegisterTagInt16.Value, Mode=OneWay, StringFormat=N0}" CaptionWidth="200" HorizontalAlignment="Left" Height="29" VerticalAlignment="Top" Width="330"  FontSize="16" FontWeight="Bold"/>
                <Controls:NumericInputBox Quality="{Binding InputRegisterTagUInt32.Quality, Converter={StaticResource QualityToBoolConverter}}" Caption="InputRegisterTagUInt32" Value="{Binding InputRegisterTagUInt32.Value, Mode=OneWay, StringFormat=N0}" CaptionWidth="200" HorizontalAlignment="Left" Height="29" VerticalAlignment="Top" Width="330"  FontSize="16" FontWeight="Bold"/>
                <Controls:NumericInputBox Quality="{Binding InputRegisterTagInt32.Quality, Converter={StaticResource QualityToBoolConverter}}" Caption="InputRegisterTagInt32" Value="{Binding InputRegisterTagInt32.Value, Mode=OneWay, StringFormat=N0}" CaptionWidth="200" HorizontalAlignment="Left" Height="29" VerticalAlignment="Top" Width="330"  FontSize="16" FontWeight="Bold"/>
                <Controls:NumericInputBox Quality="{Binding InputRegisterTagFloat.Quality, Converter={StaticResource QualityToBoolConverter}}" Caption="InputRegisterTagFloat" Value="{Binding InputRegisterTagFloat.Value, Mode=OneWay, StringFormat=N0}" CaptionWidth="200" HorizontalAlignment="Left" Height="29" VerticalAlignment="Top" Width="330"  FontSize="16" FontWeight="Bold"/>
            </StackPanel>
        </GroupBox>

        <!--<TextBlock HorizontalAlignment="Left" Margin="97,153,0,0" TextWrapping="Wrap" Text="{Binding AHT.Value, Mode=OneWay}" VerticalAlignment="Top" />
        <CheckBox Content="CheckBox" HorizontalAlignment="Left" Margin="303,102,0,0" VerticalAlignment="Top" IsChecked="{Binding Coil1.Value}"/>
        <TextBlock HorizontalAlignment="Left" Margin="303,153,0,0" TextWrapping="Wrap" Text="{Binding Coil1.Value}" VerticalAlignment="Top"/>
        <TextBlock HorizontalAlignment="Left" Margin="306,229,0,0" TextWrapping="Wrap" Text="{Binding AI.Value}" VerticalAlignment="Top"/>
        <TextBlock HorizontalAlignment="Left" Margin="304,285,0,0" TextWrapping="Wrap" Text="{Binding AIF.Value}" VerticalAlignment="Top"/>
        <Controls:NumericInputBox CaptionWidth="35" IsEditable="True" Quality="{Binding AHT.Quality, Converter={StaticResource QualityToBoolConverter}}" Caption="T1" HorizontalAlignment="Left"  VerticalAlignment="Top" Value="{Binding AHT.Value, StringFormat=N2}" FontSize="20" FontWeight="Bold" Width="123" Height="42" Margin="183,144,0,0"/>-->


    </Canvas>
</Window>
